/*
 *      13salario.cpp
 *
 *      Copyright 2007 Marcelo Araujo <<araujo@FreeBSD.org>>
 *
 *      Copyright (c) 2007 Marcelo S. Araujo
 *      All rights reserved.
 *
 *      Redistribution and use in source and binary forms, with or without
 *      modification, are permitted provided that the following conditions are
 *      met:
 *
 *      * Redistributions of source code must retain the above copyright
 *        notice, this list of conditions and the following disclaimer.
 *      * Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following disclaimer
 *        in the documentation and/or other materials provided with the
 *        distribution.
 *      * Neither the name of the Intelbras nor the names of its
 *        contributors may be used to endorse or promote products derived from
 *        this software without specific prior written permission.
 *
 *      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 */

/* Prototipo de calculo trabalhista */

#include <iostream>
#include "13salario.hpp"

using namespace std;

int main(int argc, char** argv)
{
	float salario = 0;
	int meses_trabalhados = 0;
	const int meses_ano = 12;
	float parcela1;
	float parcela2;
	float desconto_INSS;
	float desconto_IR;
	float Pagamento_INSS;
	float Salario_Liquido;

	cout << "Digite seu salario: ";
	cin >> salario;
	cout << "Digite os meses trabalhados: ";
	cin >> meses_trabalhados;
	Salario_Atributos SA(salario, meses_trabalhados, meses_ano);
	desconto_INSS = SA.Salario_Descontos_INSS(salario);
	desconto_IR = SA.Salario_Desconto_IRRF(salario);
	parcela1 = SA.Resultado_13salario_parcela1();
	parcela2 = SA.Resultado_13salario_parcela2(desconto_INSS, desconto_IR);
	Pagamento_INSS = SA.Salario_Desconto_INSS(salario, desconto_INSS);
	Salario_Liquido = SA.Salario_Com_Descontos(salario, Pagamento_INSS, desconto_IR);
	cout << "+----------------------+------------------------+" << endl;
	cout << "|      1o Parcela      |";
	cout << "       2o Parcela       |" << endl;
	cout << "+----------------------+------------------------+" << endl;
	printf("\t%0.2f", parcela1);
	printf("\t\t\t%0.2f", parcela2);
	//printf("Voce recebera 1o 13salario: %0.2f\n", parcela1);
	//printf("Voce recebera 2o 13salario: %0.2f\n", parcela2);
	cout << "\n+----------------------+------------------------+" << endl;
	cout << "      Desconto IRRF     " << endl;
	printf("\t %0.2f\n", desconto_IR);
	cout << "+----------------------+" << endl;
	cout << "      Desconto INSS     " << endl;
	cout << "\t " << Pagamento_INSS << endl;
	cout << "+-----------------------------------------------+" << endl;
	cout << "  Salario liquido:    \t\t\t" << Salario_Liquido << endl;
	cout << "+-----------------------------------------------+" << endl;
	return 0;
}

